import React from 'react'
import { Link, Control } from 'react-keeper'
import 'weui';
import moment from 'moment';
import Utils from './../../utils'
import fangzi from '../../assets/icon/房子.png';
import {Button,Page, Panel,PanelHeader, PanelBody, PanelFooter,ButtonArea, MediaBox,Cells,
  Cell,CellHeader,MediaBoxTitle,MediaBoxHeader,MediaBoxDescription,MediaBoxBody,MediaBoxInfo,Article,
  MediaBoxInfoMeta,Input,CellsTips,Icon,Label,CellsTitle,Toptips,Toast,InfiniteLoader,Popup,PopupHeader,Grids,
  Tab,Footer,FooterLinks,FooterLink,FooterText,Flex,FlexItem,CellFooter,CellBody,FormCell,PreviewButton
} from  'react-weui/build/packages';
const appMsgIcon = <img
  src=""/>



export default class TiXingInfo extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
    }
    this.mypreview = this.mypreview.bind(this);
    this.ok = this.ok.bind(this);
    this.handleClick = this.handleClick.bind(this);
    this.goList = this.goList.bind(this);
  }

  goList() {
    Control.go(this.props.txls.router,this.props.txls);
  }

  ok() {
    let resultJL = Utils.isEmptyObject(this.props.txls.relObj);
    if (resultJL.success)
    {
      this.props.onSelectInfo(this.props.txls);
    }
    else
    {
      this.props.onSelectInfo(this.props.txls);
    }


  }

  mypreview() {
    Control.go('/mypreview');
  }



  shouldComponentUpdate(nextProps = {}, nextState = {}) {
    return true;
  }

  render() {
    return (
      <div>

          <PanelBody>
            <FormCell access link onClick={this.goList}>
              <CellHeader>
                <img src={this.props.txls.icon} alt="" o style={{display: `block`, width: `20px`, marginRight: `5px`}}/>
              </CellHeader>
              <CellBody>
                <p style={{fontSize: '13px'}}>{this.props.txls.text} </p>
                <p style={{fontSize: '13px'}}>{this.props.txls.relObj.engName} </p>
                <p style={{fontSize: '13px'}}>{moment(this.props.txls.relObj.jlrq).format('YYYY-MM-DD')} </p>

              </CellBody>
              <CellFooter >
                <div style={{textAlign:'center',fontSize:'14',color:'#586C94',displsy:'-webkit-box',fontFamily:'monospace'}}>
                  ...
                </div>
              </CellFooter>
            </FormCell>

          </PanelBody>

        <Footer>
        <FooterText>&nbsp;</FooterText>
        </Footer>
      </div>



    )
  }

  componentWillMount() {



  }

  handleClick(workNo) {
    console.info(workNo);
  }

}


TiXingInfo.propTypes = {
  txls: React.PropTypes.object.isRequired,
  currentJL: React.PropTypes.object.isRequired,
  imgls: React.PropTypes.object.isRequired
}

